<template>
  <div class="basic_info">
    <div class="info_operation_btn">
      <div class="btn_left">
        <el-button type="primary" @click="onRefresh">统计</el-button>
        <el-button @click="exportExcel()" :disabled="!buttonsPermissions.DaoChu"
          :class="!buttonsPermissions.DaoChu ? 'disabled_button' : ''">导出</el-button>
        <el-button :disabled="!buttonsPermissions.DaYin" :class="!buttonsPermissions.DaYin ? 'disabled_button' : ''"
          @click="handleShortcutKeyPrint">打印(P)</el-button>
      </div>
      <div class="btn_right">
        <el-input v-model="queryData.keywords" placeholder="请输入往来单位\经手人关键字搜索"></el-input>
        <el-button type="primary" @click="onQuery">搜索</el-button>
        <el-button @click="onRefresh">刷新</el-button>
        <i @click="onShowColumn()" class="set_up el-icon-s-tools"></i>
      </div>
    </div>
    <div class="info_content_div">
      <div class="div_table">
        <div class="div_screen">
          <div class="screen_left">
            <div class="line_dialog">
              <p>往来单位</p>
              <p class="dialog_input">
                <el-tooltip effect="dark" :content="getDictTextById(supplierOptions, queryData.companyId, 'companyName')"
                  :enterable="false" placement="bottom-start"
                  :disabled="this.getHideToolTipById(supplierOptions, queryData.companyId, 'companyName')">
                  <el-select v-model="queryData.companyId" filterable ref="wanglaidanwei"
                    @visible-change="(value) => handleFilterMethod('', 'companyName')"
                    :filter-method="(value) => handleFilterMethod(value, 'companyName')">
                    <el-option v-for="item in supplierOptions" :key="item.id" :label="item.companyName" :value="item.id">
                    </el-option>
                    <el-option value>
                      <div @click.stop="onShowSupplierAdd" style="display: flex; justify-content: center">
                        <span><i class="el-icon-plus"></i>新增</span>
                      </div>
                    </el-option>
                  </el-select>
                </el-tooltip>
                <i class="el-icon-more" @click.stop="onShowSupplier"></i>
              </p>
            </div>
            <div>
              <p>经手人</p>
              <el-select v-model="queryData.sysUserId" class="screen_select" ref="jingshouren" filterable
                @visible-change="(value) => handleFilterMethod('', 'realname')"
                :filter-method="(value) => handleFilterMethod(value, 'realname')">
                <el-option v-for="item in jsrOptions" :key="item.id" :label="item.realname" :value="item.id">
                </el-option>
              </el-select>
            </div>
            <div>
              <p>调整项目</p>
              <el-select v-model="queryData.orderType" @change="onChangeType" class="screen_select">
                <el-option v-for="item in tzxmOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
          </div>
          <div class="screen_right">
            <el-select @change="changeDate" v-model="monthValue">
              <el-option v-for="item in monthOptions" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
            <el-date-picker v-if="isShowDate" v-model="nowDate" type="daterange" range-separator="~"
              start-placeholder="开始日期" end-placeholder="结束日期" @change="onClickPicker" value-format="yyyy-MM-dd">
            </el-date-picker>
            <el-button type="primary" @click="onQuery">查询</el-button>
          </div>
        </div>
        <div class="table_content">
          <el-table ref="table" show-summary :summary-method="getSummaries" highlight-current-row :header-cell-style="{
            color: '#666666',
            textAlign: 'center',
            height: '30px',
            borderColor: '#dddddd',
          }" :data="tableData" height="100%" style="width: 100%">
            <el-table-column :resizable="false" label="序号" type="index" width="50" align="center"></el-table-column>
            <template v-for="(item, index) in columnData">
              <el-table-column :show-overflow-tooltip="true" :key="index"
                :label="item.zidingyiName ? item.zidingyiName : item.morenName" v-if="item.zidingyiState"
                :prop="item.props" min-width="120px" :sortable="item.sortable" :align="item.align ? item.align : 'left'"
                :width="item.cellWidth">
              </el-table-column>
            </template>
          </el-table>
        </div>
        <div class="table_pagination">
          <div class="pagination_div">
            <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :current-page="queryData.pageNo" :page-sizes="[20, 50, 100, 200]" :page-size="queryData.pageSize"
              layout="jumper, prev, pager,next, sizes" :total="total">
            </el-pagination>
          </div>
        </div>
      </div>
    </div>
    <!-- 列配置弹框 -->
    <CConfiguration ref="setColumnRef" :columnDataArr="columnData" :defaultColumnDataArr="defaultColumnData"
      orderType="应收应付调整记录" @onSaveColumn="onSaveColumn"></CConfiguration>
    <!-- 新增树形结构数据弹框 -->
    <NewCategory v-if="showNewTree" :newTreeData="newTreeData" @onSaveTreeChanges="onSaveTreeChanges"
      @onCancelTree="onCancelTree"></NewCategory>
    <!-- 选择往来单位弹框 -->
    <DialogSupplier ref="supplierRef" @onSelectSupplier="onSelectSupplier"></DialogSupplier>
    <!-- 新增往来单位弹框 -->
    <DialogSupplierAdd ref="supplierAddRef" :newData="newData" @dialogVisibleClose="onCloseAddSupplier"
      @onAddSubmit="onAddSupplier"></DialogSupplierAdd>
    <!-- 打印 -->
    <dialog-print ref="print"></dialog-print>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import CConfiguration from '@/components/c_column/columnConfiguration1'
import NewCategory from '@/components/c_category/NewCategory'
import DialogSupplier from '../../components/dialogSupplier'
import DialogSupplierAdd from '../../components/dialogSupplierAdd'
/**打印 */
import dialogPrint from '@/views/components/dialogPrintRecord'
import { getAction, postAction, downPostFile } from '@/api/manage'
// 导入调用处理权限数据方法
import { handlePermissions, handleOtherPerms, formatMoney, delcommafy } from '@/utils/index'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'

export default {
  name: 'payableAdjustment',
  components: {
    CConfiguration,
    NewCategory,
    DialogSupplier,
    DialogSupplierAdd,
    dialogPrint,
  },
  computed: {
    ...mapGetters(['name']),
    buttonsPermissions() {
      return handlePermissions('应收应付调整记录')
    },
    printPermissions() {
      return handleOtherPerms('单据可多次打印')
    },
  },
  mixins: [JeecgListMixin],
  data() {
    return {
      // 往来单位
      supplierOptions: [],
      // 经手人
      jsrOptions: [],
      // 调整项目
      tzxmOptions: [
        {
          value: '23',
          label: '应付款增加',
        },
        {
          value: '24',
          label: '应付款减少',
        },
        {
          value: '21',
          label: '应收款增加',
        },
        {
          value: '22',
          label: '应收款减少',
        },
      ],
      // 查询条件数据
      queryData: {
        // 筛选
        companyId: '',
        sysUserId: '',
        orderType: '',	// 单据类型：21-应收款增加  22-应收款减少  23-应付款增加 24-应付款减少
        keywords: '',//搜索框值
        storehouseId: '',
        startDate: '', // 开始时间
        finishDate: '',// 结束时间
        pageNo: 1,//默认开始页面
        pageSize: 20,//每页的数据条数
      },
      // 月份选择
      monthValue: '本月',
      monthOptions: [
        {
          value: '今日',
          label: '今日',
        },
        {
          value: '本周',
          label: '本周',
        },
        {
          value: '本月',
          label: '本月',
        },
        {
          value: '本年',
          label: '本年',
        },
      ],
      isShowDate: true, // 是否显示选择时间组件
      nowDate: [],
      // 表格数据
      tableData: [],
      // 列配置数据
      columnData: [
        {
          morenName: '单据编号',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '170px',
          props: 'billNumber',
        },
        {
          morenName: '调整项目',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '120px',
          props: 'billTypeText',
        },
        {
          morenName: '往来单位',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '120px',
          props: 'companyName',
        },
        {
          morenName: '经手人',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '120px',
          props: 'sysUserName',
        },
        {
          morenName: '费用名称',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '170px',
          props: 'feeTypeName',
        },
        {
          morenName: '金额',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '120px',
          props: 'feeMoney',
        },
        {
          morenName: '摘要',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '170px',
          props: 'remark',
        },
        {
          morenName: '调整原因',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '170px',
          props: 'changeRemark',
        },
        {
          morenName: '调整人',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '120px',
          props: 'createName',
        },
        {
          morenName: '调整时间',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '170px',
          props: 'createTime',
        },
        {
          morenName: '单据状态',
          zidingyiName: '',
          morenState: true,
          zidingyiState: true,
          noModify: false,
          sortable: true,
          cellWidth: '120px',
          props: 'billStatusText',
        },
      ],
      showNewTree: false, //显示树形结构数据新增弹框
      // 传递数据给新增树形结构组件
      newTreeData: {
        parentNode: '',
        nowNode: '',
      },
      newData: {},
      defaultColumnData: [],// 默认列配置
      columnKey: '应收应付调整记录',// 列配置的标识key
      updateId: '', // 修改列配置时返回的id
      total: 0, // 总条数
      url: {
        exportXlsUrl: '/xghShouldCollectionPayChange/xghShouldCollectionPayChange/exportRecords'
      }, // 导出地址
      billName: '应收应付调整记录',
      printClick: false,
    }
  },
  created() {
    // 初始化数据
    this.initData()
  },
  updated() {
    this.$nextTick(() => {
      this.$refs.table.doLayout()
    })
  },
  mounted() {
  },
  methods: {
    // 打印
    handleShortcutKeyPrint() {
      this.printClick = true
      this.onQuery()
    },
    handlePrint() {
      if (!this.buttonsPermissions.DaYin) {
        this.$elMessage.warning('未拥有打印权限！')
      } else if (!this.tableData || this.tableData.length <= 0) {
        this.$elMessage.warning('没有要打印的记录！')
      } else {
        let printData = {
          riqi: this.queryData.startDate.split(' ')[0] + '~' + this.queryData.finishDate.split(' ')[0],
          wanglaidanwei: this.$refs.wanglaidanwei.selected.label,
          jingshouren: this.$refs.jingshouren.selected.label,
          printExclusive: JSON.parse(JSON.stringify(this.tableData))
        }
        // 可以多次打印设置
        if (this.printPermissions) {
          this.$refs.print.show(printData, this.columnData, this.billName)
        } else {
          if (this.$lcStorage.get('printLimitValue')) {
            // 获取打印次数
            this.getPrintNum(this.billName, (() => {
              this.$refs.print.show(printData, this.columnData, this.billName)
            }))
          } else {
            this.$refs.print.show(printData, this.columnData, this.billName)
          }
        }
      }
    },
    // 初始化查询列配置值
    async selectTitle() {
      let obj = await this.$setColumn.selectColumn(this.columnKey)
      if (obj.code === 200) {
        this.updateId = obj.updateId
        this.columnData = obj.columnData
      } else if (obj.code === 500) {
        let id = await this.$setColumn.addColumn(this.columnKey, this.defaultColumnData, 'props')
        this.updateId = id
        this.columnData = this.defaultColumnData
      } else if (obj.code === 404) {
        this.columnData = this.defaultColumnData
      }
    },
    // 修改列配置后保存修改后的值
    async onSaveColumn(value) {
      this.columnData = value
      let res = await this.$setColumn.editColumn(this.columnKey, this.columnData, this.updateId)
      if (res.code == 200) {
        this.$elMessage.success(res.message)
      } else {
        this.$elMessage.error(res.message)
      }
    },
    // 导出
    exportExcel() {
      const fileName = '应收应付调整记录'
      let params = {
        ...this.queryData,
        fileName
      }
      this.handleExportXlsByStaff(fileName, params)
    },
    initData() {
      this.getTimeRange(this.$setTimeRange(5))
      // 往来单位-下拉框初始化
      this.getSupplierOptions()
      this.getStaffData()
      this.onRefresh()

      // 初始化列配置数据
      this.defaultColumnData = this.columnData
      this.selectTitle()
    },
    // 刷新
    onRefresh() {
      Object.assign(this.$data.queryData, this.$options.data().queryData)
      this.changeTzxm = ''
      this.selectTitle()
      this.monthValue = '本月'
      this.getTimeRange(this.$setTimeRange(5))
      let str = JSON.stringify(this.queryData)
      let arr = JSON.parse(str)
      this.requestQuery(arr)
    },
    // 查询
    onQuery() {
      this.queryData.pageNo = 1
      this.getData()
    },
    // 获取数据
    getData() {
      let str = JSON.stringify(this.queryData)
      let arr = JSON.parse(str)
      let obj = {
        ...arr,
      }
      this.requestQuery(obj)
    },
    // 请求筛选条件数据
    requestQuery(obj) {
      getAction('/xghShouldCollectionPayChange/xghShouldCollectionPayChange/queryRecords', obj).then((res) => {
        if (res.code === 200) {
          this.total = res.result.total
          let data = res.result.records || []
          data.forEach(item => {
            item.billNumber = item.xghShouldCollectionPayChange.billNumber
            item.companyName = item.xghShouldCollectionPayChange.companyName
            item.sysUserName = item.xghShouldCollectionPayChange.sysUserName
            item.createName = item.xghShouldCollectionPayChange.createName
            item.feeMoney = formatMoney(item.feeMoney)
            // 单据类型：21-应收款增加  22-应收款减少  23-应付款增加 24-应付款减少
            switch (item.xghShouldCollectionPayChange.orderType) {
              case "21":
                item.billTypeText = '应收款增加'
                break;
              case "22":
                item.billTypeText = '应收款减少'
                break;
              case "23":
                item.billTypeText = '应付款增加'
                break;
              case "24":
                item.billTypeText = '应付款减少'
                break;
            }
            item.changeRemark = item.xghShouldCollectionPayChange.remark
            //0.待审核 5.审核通过 10.作废 15.反审 20.红冲 25.终止 30.完成
            if (item.xghShouldCollectionPayChange.billStatus == '0') {
              item.billStatusText = "待审核"
            } else if (item.xghShouldCollectionPayChange.billStatus == '5') {
              item.billStatusText = "已审核"
            } else if (item.xghShouldCollectionPayChange.billStatus == '10') {
              item.billStatusText = "已作废"
            } else if (item.xghShouldCollectionPayChange.billStatus == '15') {
              item.billStatusText = "已反审"
            } else if (item.xghShouldCollectionPayChange.billStatus == '20') {
              item.billStatusText = "已红冲"
            }
          })
          this.tableData = data
        } else {
          this.$elMessage.error(res.message)
        }
        if (this.printClick) {
          this.handlePrint()
        }
        this.printClick = false
      })
    },
    // 获取往来单位信息
    getSupplierOptions() {
      getAction('/xghCompany/xghCompany/listNoPage', {}).then((res) => {
        if (res.code === 200) {
          this.supplierOptions = res.result
          this.totalCompanys = res.result
        } else {
          this.$elMessage.error(res.message)
        }
      })
    },
    // 经手人信息-下拉框初始化
    getStaffData() {
      getAction('/dept/xghAccountBookDept/getAllDeptUsers', {}).then((res) => {
        if (res.code === 200) {
          this.jsrOptions = res.result
          this.totalPersons = res.result
        }
      })
    },
    // 切换调整项目
    onChangeType(val) {
      // 查找需要修改的列
      this.columnData.forEach(item => {
        // 单据类型：21-应收款增加  22-应收款减少  23-应付款增加 24-应付款减少
        if (item.props == 'feeTypeName') {
          switch (this.queryData.orderType) {
            case "21":
              item.morenName = '收入名称'
              break;
            case "22":
              item.morenName = '费用名称'
              break;
            case "23":
              item.morenName = '费用名称'
              break;
            case "24":
              item.morenName = '收入名称'
              break;
          }
        }
      })
    },
    // 判断当前选择时间段
    changeDate(val) {
      this.isShowDate = true
      switch (val) {
        case '全部':
          this.isShowDate = false
          break
        case '今日':
          this.getTimeRange(this.$setTimeRange(1))
          break
        case '昨天':
          this.getTimeRange(this.$setTimeRange(2))
          break
        case '本周':
          this.getTimeRange(this.$setTimeRange(3))
          break
        case '上周':
          this.getTimeRange(this.$setTimeRange(4))
          break
        case '本月':
          this.getTimeRange(this.$setTimeRange(5))
          break
        case '上月':
          this.getTimeRange(this.$setTimeRange(6))
          break
        case '本年':
          this.getTimeRange(this.$setTimeRange(7))
          break
        case '去年':
          this.getTimeRange(this.$setTimeRange(8))
          break
        default:
          break
      }
    },
    // 获取时间范围并设置
    getTimeRange(data) {
      this.nowDate = [data.now, data.end]
      this.queryData.startDate = data.now + ' 00:00:00'
      this.queryData.finishDate = data.end + ' 23:59:59'
    },
    // 获取当前选中时间
    onClickPicker(val) {
      this.queryData.startDate = val[0] + ' 00:00:00'
      this.queryData.finishDate = val[1] + ' 23:59:59'
    },
    // 类别信息新增/修改后数据获取
    onSaveTreeChanges(value) {
      this.showNewTree = false
      if (this.dialogVisible) {
        this.ruleForm.dwlb = value.lbmc
      } else {
        let tree = this.TreeData
        // this.findTreeNode(tree, value)
        if (this.newTreeData.state == 'add') {
          this.addTreeNode(tree, value)
        } else if (this.newTreeData.state == 'edit') {
          this.editTreeNode(tree, value)
        }
      }
    },
    // 新增树形节点
    addTreeNode(tree, value) {
      for (let i = 0; i < tree.length; i++) {
        if (tree[i].label == this.newTreeData.nowNode) {
          if (!tree[i].children) {
            this.$set(tree[i], 'children', [])
          }
          tree[i].children.push({
            label: value.lbmc,
            type: String(Number(tree[i].type) + 1),
          })
          return
        } else {
          let treeChildren = this.TreeData[i].children
          for (let i1 = 0; i1 < treeChildren.length; i1++) {
            if (treeChildren[i1].label == this.newTreeData.nowNode) {
              if (!treeChildren[i1].children) {
                this.$set(treeChildren[i1], 'children', [])
              }
              treeChildren[i1].children.push({
                label: value.lbmc,
                type: String(Number(treeChildren[i1].type) + 1),
              })
              return
            } else {
              let treeCChildren = treeChildren[i1].children
              for (let i2 = 0; i2 < treeCChildren.length; i2++) {
                if (treeCChildren[i2].label == this.newTreeData.nowNode) {
                  if (!treeCChildren[i2].children) {
                    this.$set(treeCChildren[i2], 'children', [])
                  }
                  treeCChildren[i2].children.push({
                    label: value.lbmc,
                    type: String(Number(treeCChildren[i2].type) + 1),
                  })
                  return
                }
              }
            }
          }
        }
      }
    },
    // 修改树形节点
    editTreeNode(tree, value) {
      for (let i = 0; i < tree.length; i++) {
        if (tree[i].label == this.newTreeData.nowNode) {
          tree[i].label = value.lbmc
          return
        } else {
          let treeChildren = this.TreeData[i].children
          for (let i1 = 0; i1 < treeChildren.length; i1++) {
            if (treeChildren[i1].label == this.newTreeData.nowNode) {
              tree[i].label = value.sjlb
              treeChildren[i1].label = value.lbmc
              return
            } else {
              let treeCChildren = treeChildren[i1].children
              for (let i2 = 0; i2 < treeCChildren.length; i2++) {
                if (treeCChildren[i2].label == this.newTreeData.nowNode) {
                  treeChildren[i1].label = value.sjlb
                  treeCChildren[i2].label = value.lbmc
                  return
                }
              }
            }
          }
        }
      }
    },
    // 找到当前需要新增或修改的树形节点（递归循环，暂未使用）
    findTreeNode(tree, value) {
      for (let i = 0; i < tree.length; i++) {
        console.log(tree[i].label, this.newTreeData.nowNode, '123')
        if (tree[i].label == this.newTreeData.nowNode) {
          console.log(tree[i].children, '找到啦')
          if (!tree[i].children) {
            this.$set(tree[i], 'children', [])
          }
          tree[i].children.push({
            label: value.lbmc,
            type: String(Number(tree[i].type) + 1),
          })
          return
        } else {
          console.log('没找到')
          this.findTreeNode(tree[i].children, value)
        }
      }
    },
    // 类别信息取消按钮触发
    onCancelTree() {
      this.showNewTree = false
    },
    // 触发列配置弹框
    onShowColumn() {
      this.$refs.setColumnRef.dialogVisible = true
    },
    // 合计列计算
    getSummaries(param) {
      const { columns, data } = param
      const sums = []
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计'
        } else if (index === 1) {
          sums[index] = '共' + this.total + '条明细'
        } else if (column.property === 'feeMoney') {
          const values = data.map((item) => delcommafy(item[column.property]))
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
              const value = delcommafy(curr)
              if (!isNaN(value)) {
                return prev + curr
              } else {
                return prev
              }
            }, 0)
            sums[index] = formatMoney(sums[index]) // 保留2位小数，解决小数列合计精度缺失的问题
          }
        } else {
          sums[index] = ''
        }
      })
      return sums
    },
    // 获取每页几条数据
    handleSizeChange(val) {
      this.queryData.pageSize = val
      this.getData()
    },
    // 获取当前第几页
    handleCurrentChange(val) {
      this.queryData.pageNo = val
      this.getData()
    },
    // 打开新增往来单位弹出框
    onShowSupplierAdd() {
      this.newData = {
        id: '',
        companyName: '',
        companyUserName: '',
        xghCompanyNatureId: '',
        xghCompanyNature: '',
        companyPhone: '',
        companyPinyinCode: '',
        companyLandline: '',
        xghCompanyTypeId: '', //单位类别
        xghCompanyType: '',
        business: '',
        provinceName: '', //省
        provinceCode: '',
        cityName: '', //市
        cityCode: '',
        countyName: '', //区县
        countyCode: '',
        address: '',
        setPrice: '',
        setDiscountPrice: '',
        companyInvoiceStatus: true,
        depositBank: '',
        bankName: '',
        bakCard: '',
        taxNumber: '',
        invoiceAddress: '',
        bankPhone: '',
        companyRAndPStatus: true,
        beginReceivable: 0,
        beginPayable: 0,
        totalReceivable: 0,
        totalPayable: 0,
        receivableQuota: '',
        payableQuota: '',
        receivableTime: '',
        payableTime: '',
        companyRemark: '',
      }
      this.$refs.supplierAddRef.dialogVisible = true
    },
    // 新增往来单位数据
    onAddSupplier(res) {
      this.getSupplierOptions()
    },
    // 打开选择往来单位弹出框
    onShowSupplier() {
      this.$refs.supplierRef.dialogVisible = true
    },
    // 当前选择往来单位数据
    onSelectSupplier(val) {
      this.queryData.companyId = val.id
    },
    onCloseAddSupplier() {
      this.newData = this.$options.data().newData
    },
    // 搜索
    handleFilterMethod(value, label) {
      if (label == 'companyName') {
        this.supplierOptions = this.filterMethod(this.supplierOptions, value, label)
      } else if (label == 'realname') {
        this.jsrOptions = this.filterMethod(this.jsrOptions, value, label)
      }
    },
  },
}
</script>

<style lang="scss" scoped>
$font-size: 12px;
$height-input: 30px; //0.55rem的高度
$height: 50px; //1rem的高度

.basic_info {
  width: 100%;
  height: calc(100vh - 1.875117rem);
  background: #f0f2f5;
  box-sizing: border-box;
  padding: 0 0.168761rem 0.168761rem;
  display: flex;
  flex-direction: column;
}

.info_operation_btn {
  width: 100%;
  height: $height;
  display: flex;
  align-items: center;

  ::v-deep .el-button {
    width: 80px;
    height: $height-input;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: $font-size;
    border-radius: 0.1rem;
    border: none;
    margin-right: 6px;
    margin-left: 0;
  }

  .el-button--default {
    color: #666;
  }

  ::v-deep .el-select {
    width: 1rem;
    height: $height-input;
    box-sizing: border-box;
    margin-right: 0.112507rem;

    .el-input {
      .el-input__inner {
        height: $height-input;
        border: none;
        font-size: $font-size;
      }

      .el-input__suffix {
        height: $height-input;
        display: flex;
        align-items: center;
      }
    }
  }

  .btn_left {
    width: 60%;
    display: flex;
    justify-content: flex-start;
    align-items: center;

    p {
      font-size: $font-size;
      color: #666;
      margin: 0 0.1rem 0 0.187512rem;
    }

    ::v-deep .el-checkbox {
      display: flex;
      align-items: center;
      margin-left: 0.168761rem;

      .el-checkbox__input {
        height: 0.25rem;
      }

      .el-checkbox__label {
        font-size: $font-size;
        padding-left: 0.1rem;
        color: #666;
      }

      .is-checked {
        .el-checkbox__inner {
          background: #1a93fa;
          border-color: #1a93fa;
        }
      }
    }
  }

  .btn_right {
    width: 40%;
    display: flex;
    justify-content: flex-end;
    align-items: center;

    .el-input {
      width: 4.725295rem;
      height: $height-input;
      margin-right: 0.112507rem;

      ::v-deep .el-input__inner {
        height: $height-input;
        border: none;
        box-sizing: border-box;
        padding: 0 0.15rem;
        background: #fff;
        font-size: $font-size;
        color: #666;

        &::placeholder {
          font-size: $font-size;
          color: #c1c1c1;
        }
      }
    }

    .el-button {
      width: 1rem;
    }

    .set_up {
      font-size: 20px;
      color: rgb(153, 153, 153);
    }
  }
}

.info_content_div {
  width: 100%;
  height: calc(100% - 1rem);
  background: #fff;
  box-sizing: border-box;
  padding: 0 0.168761rem;
  display: flex;

  .div_table {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;

    // justify-content: space-between;
    .div_screen {
      width: 100%;
      height: $height-input;
      margin-top: 15px;
      display: flex;
      justify-content: space-between;

      ::v-deep .el-select {
        width: 2.250141rem;
        height: $height-input;
        box-sizing: border-box;
        border-radius: 4px;

        .el-input {
          .el-input__inner {
            height: $height-input;
            border-color: #e3e3e3;
            font-size: $font-size;
            padding-left: 0.15rem;
          }

          .el-input__suffix {
            height: $height-input;
            display: flex;
            align-items: center;
          }
        }
      }

      input {
        width: 2.250141rem;
        height: $height-input;
        background: #ffffff;
        border: 1px solid #e3e3e3;
        opacity: 1;
        border-radius: 4px;
        font-size: $font-size;
        color: #666;
        box-sizing: border-box;
        padding: 0 0.15rem;

        &:focus {
          outline: none;
          border-color: #1890ff;
        }
      }

      .screen_left {
        // (50+5+120+15)*4=760px
        width: 12rem;
        height: 100%;
        box-sizing: border-box;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;

        >div {
          width: 176px;
          height: $height-input;
          box-sizing: border-box;
          display: flex;
          align-items: center;
          margin-right: 19px;

          >p {
            margin: 0;
            width: auto;
            min-width: 50px;
            margin-right: 6px;
            font-size: $font-size;
            font-family: PingFang SC;
            font-weight: 400;
            color: #666666;
            text-align: justify;
            text-justify: distribute-all-lines;
            /*ie6-8*/
            text-align-last: justify;
            /* ie9*/
            -moz-text-align-last: justify;
            /*ff*/
            -webkit-text-align-last: justify;
            /*chrome 20+*/
          }

          .screen_select {
            flex: 1;
            display: flex;
            align-items: center;
            margin-right: 0;
            text-align: left;
            text-align-last: left;
          }
        }

        .line_dialog {
          .dialog_input {
            flex: 1;
            position: relative;
            display: flex;
            align-items: center;
            // justify-content: flex-end;
            margin-right: 0;
            text-align: left;
            text-align-last: left;

            ::v-deep .el-select {
              i {
                display: none;
              }
            }

            i {
              position: absolute;
              right: 8px;
              color: #bfbfbf;
              font-size: $font-size;
              cursor: pointer;
            }
          }
        }
      }

      .screen_right {
        // (50+5+120+15)*4=760px
        width: calc(100% - 12rem);
        height: 100%;
        box-sizing: border-box;
        display: flex;
        justify-content: flex-end;
        align-items: flex-start;
        box-sizing: border-box;

        ::v-deep .el-button {
          width: 1rem;
          height: $height-input;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: $font-size;
          border-radius: 0.1rem;
          border: none;
        }

        ::v-deep .el-select {
          width: 80px;
          margin-right: 6px;
        }

        ::v-deep .el-date-editor {
          width: 178px;
          height: $height-input;
          background: #ffffff;
          border: 1px solid #d9d9d9;
          margin-right: 6px;
          padding: 3px 6px;

          .el-range__icon {
            position: absolute;
            right: 0;
            line-height: 30px;
          }

          .el-range-separator {
            line-height: 24px;
          }

          .el-range-input {
            font-size: $font-size;
          }

          .el-range__close-icon {
            display: none;
          }
        }
      }
    }

    .table_content {
      height: calc(100% - 70px - 60px);
      margin-top: 12px;

      ::v-deep .el-table {
        border: 1px solid #e3e3e3;
        border-bottom: none;
        box-sizing: border-box;

        th,
        td {
          padding: 0;
          color: #666;
          box-sizing: border-box;
          border-right: 1px solid #e3e3e3;
          height: $height-input;
          font-size: $font-size;

          &:first-child {
            .cell {
              justify-content: center;
              padding: 0;
            }
          }
        }

        th {
          .cell {
            display: block;
            line-height: $height-input;
            height: $height-input;
            background: #ededed;
          }
        }

        .el-table__body tr:hover>td {
          background: #e3f6ff;
        }

        .el-table__footer-wrapper {
          td {
            background: #f4f4f4;
            border: none;
          }
        }

        //滚动条的宽度
        ::-webkit-scrollbar {
          width: 8px;
          height: 10px;
          background-color: #e5e5e5;
        }

        //滚动条的滑块
        ::-webkit-scrollbar-thumb {
          background-color: #c9c9c9;
        }
      }
    }

    .table_pagination {
      width: 100%;
      height: $height;
      box-sizing: border-box;
      padding-top: 30px;
      display: flex;

      .pagination_div {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;

        ::v-deep .el-pagination {
          padding: 0;
          height: 0.525033rem;

          .el-pagination__sizes {
            margin: 0;

            .el-input {
              margin-right: 0;
            }
          }
        }
      }
    }
  }
}
</style>